#include <iostream>
#include <string>
void union_demo();

union position {
    int x;
    double y;
};
using namespace std;
void union_demo()
{
    position a;
    a.x = 12;
    cout << "x=" << a.x << endl;
    cout << "y=" << a.y << endl;
    a.y = 2.5;
    cout << "x=" << a.x << endl;
    cout << "y=" << a.y << endl;
}